.class public Lcom/noshufou/android/su/widget/SlidingPanel;
.super Landroid/view/ViewGroup;
.source "SlidingPanel.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/noshufou/android/su/widget/SlidingPanel$AnimationFiller;,
        Lcom/noshufou/android/su/widget/SlidingPanel$Toggler;
    }
.end annotation


# instance fields
.field private mAnchor:Landroid/view/View;

.field private mAnchorId:I

.field private mAnimating:Z

.field private mButton:Landroid/view/View;

.field private mButtonId:I

.field private mClosedLimit:I

.field private mContent:Landroid/view/View;

.field private mContentId:I

.field private mExpanded:Z

.field private mFillOffset:I

.field private mOpenOverlap:I


# direct methods
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
    .locals 1
    .parameter "context"
    .parameter "attrs"

    .prologue
    .line 35
    const/4 v0, 0x0

    invoke-direct {p0, p1, p2, v0}, Lcom/noshufou/android/su/widget/SlidingPanel;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    .line 36
    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
    .locals 7
    .parameter "context"
    .parameter "attrs"
    .parameter "defStyle"

    .prologue
    const/4 v6, 0x1

    const/4 v5, 0x0

    .line 39
    invoke-direct {p0, p1, p2, p3}, Landroid/view/ViewGroup;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    .line 29
    iput-boolean v5, p0, Lcom/noshufou/android/su/widget/SlidingPanel;->mAnimating:Z

    .line 30
    iput v5, p0, Lcom/noshufou/android/su/widget/SlidingPanel;->mFillOffset:I

    .line 32
    iput-boolean v6, p0, Lcom/noshufou/android/su/widget/SlidingPanel;->mExpanded:Z

    .line 40
    sget-object v4, Lcom/noshufou/android/su/R$styleable;->SlidingPanel:[I

    invoke-virtual {p1, p2, v4, p3, v5}, Landroid/content/Context;->obtainStyledAttributes(Landroid/util/AttributeSet;[III)Landroid/content/res/TypedArray;

    move-result-object v0

    .line 43
    .local v0, a:Landroid/content/res/TypedArray;
    invoke-virtual {v0, v5, v5}, Landroid/content/res/TypedArray;->getResourceId(II)I

    move-result v2

    .line 44
    .local v2, buttonId:I
    if-nez v2, :cond_0

    .line 45
    new-instance v4, Ljava/lang/IllegalArgumentException;

    const-string v5, "The button attribute is required and must refer to a valid child"

    invoke-direct {v4, v5}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v4

    .line 49
    :cond_0
    invoke-virtual {v0, v6, v5}, Landroid/content/res/TypedArray;->getResourceId(II)I

    move-result v1

    .line 50
    .local v1, anchorId:I
    if-ne v1, v2, :cond_1

    .line 51
    new-instance v4, Ljava/lang/IllegalArgumentException;

    const-string v5, "The anchor attribute is required and must refer to a different child"

    invoke-direct {v4, v5}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v4

    .line 55
    :cond_1
    const/4 v4, 0x2

    invoke-virtual {v0, v4, v5}, Landroid/content/res/TypedArray;->getResourceId(II)I

    move-result v3

    .line 56
    .local v3, contentId:I
    if-eq v3, v1, :cond_2

    if-ne v3, v2, :cond_3

    .line 57
    :cond_2
    new-instance v4, Ljava/lang/IllegalArgumentException;

    const-string v5, "The content attribute is required and must refer to a different child"

    invoke-direct {v4, v5}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v4

    .line 61
    :cond_3
    const/4 v4, 0x3

    invoke-virtual {v0, v4, v5}, Landroid/content/res/TypedArray;->getDimensionPixelSize(II)I

    move-result v4

    iput v4, p0, Lcom/noshufou/android/su/widget/SlidingPanel;->mOpenOverlap:I

    .line 62
    const/4 v4, 0x4

    invoke-virtual {v0, v4, v5}, Landroid/content/res/TypedArray;->getDimensionPixelSize(II)I

    move-result v4

    iput v4, p0, Lcom/noshufou/android/su/widget/SlidingPanel;->mClosedLimit:I

    .line 64
    invoke-virtual {v0}, Landroid/content/res/TypedArray;->recycle()V

    .line 66
    iput v2, p0, Lcom/noshufou/android/su/widget/SlidingPanel;->mButtonId:I

    .line 67
    iput v1, p0, Lcom/noshufou/android/su/widget/SlidingPanel;->mAnchorId:I

    .line 68
    iput v3, p0, Lcom/noshufou/android/su/widget/SlidingPanel;->mContentId:I

    .line 69
    return-void
.end method

.method static synthetic access$0(Lcom/noshufou/android/su/widget/SlidingPanel;)Z
    .locals 1
    .parameter

    .prologue
    .line 29
    iget-boolean v0, p0, Lcom/noshufou/android/su/widget/SlidingPanel;->mAnimating:Z

    return v0
.end method

.method static synthetic access$1(Lcom/noshufou/android/su/widget/SlidingPanel;Z)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 29
    iput-boolean p1, p0, Lcom/noshufou/android/su/widget/SlidingPanel;->mAnimating:Z

    return-void
.end method

.method static synthetic access$2(Lcom/noshufou/android/su/widget/SlidingPanel;)Landroid/view/View;
    .locals 1
    .parameter

    .prologue
    .line 24
    iget-object v0, p0, Lcom/noshufou/android/su/widget/SlidingPanel;->mContent:Landroid/view/View;

    return-object v0
.end method

.method static synthetic access$3(Lcom/noshufou/android/su/widget/SlidingPanel;)I
    .locals 1
    .parameter

    .prologue
    .line 30
    iget v0, p0, Lcom/noshufou/android/su/widget/SlidingPanel;->mFillOffset:I

    return v0
.end method

.method static synthetic access$4(Lcom/noshufou/android/su/widget/SlidingPanel;)Landroid/view/View;
    .locals 1
    .parameter

    .prologue
    .line 20
    iget-object v0, p0, Lcom/noshufou/android/su/widget/SlidingPanel;->mButton:Landroid/view/View;

    return-object v0
.end method

.method static synthetic access$5(Lcom/noshufou/android/su/widget/SlidingPanel;)Z
    .locals 1
    .parameter

    .prologue
    .line 32
    iget-boolean v0, p0, Lcom/noshufou/android/su/widget/SlidingPanel;->mExpanded:Z

    return v0
.end method


# virtual methods
.method protected onFinishInflate()V
    .locals 2

    .prologue
    .line 73
    iget v0, p0, Lcom/noshufou/android/su/widget/SlidingPanel;->mButtonId:I

    invoke-virtual {p0, v0}, Lcom/noshufou/android/su/widget/SlidingPanel;->findViewById(I)Landroid/view/View;

    move-result-object v0

    iput-object v0, p0, Lcom/noshufou/android/su/widget/SlidingPanel;->mButton:Landroid/view/View;

    .line 74
    iget-object v0, p0, Lcom/noshufou/android/su/widget/SlidingPanel;->mButton:Landroid/view/View;

    if-nez v0, :cond_0

    .line 75
    new-instance v0, Ljava/lang/IllegalArgumentException;

    const-string v1, "The handle attribute must refer to a child"

    invoke-direct {v0, v1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v0

    .line 78
    :cond_0
    iget v0, p0, Lcom/noshufou/android/su/widget/SlidingPanel;->mAnchorId:I

    invoke-virtual {p0, v0}, Lcom/noshufou/android/su/widget/SlidingPanel;->findViewById(I)Landroid/view/View;

    move-result-object v0

    iput-object v0, p0, Lcom/noshufou/android/su/widget/SlidingPanel;->mAnchor:Landroid/view/View;

    .line 79
    iget-object v0, p0, Lcom/noshufou/android/su/widget/SlidingPanel;->mAnchor:Landroid/view/View;

    if-nez v0, :cond_1

    .line 80
    new-instance v0, Ljava/lang/IllegalArgumentException;

    const-string v1, "The anchor attribute must refer to a child"

    invoke-direct {v0, v1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v0

    .line 83
    :cond_1
    iget v0, p0, Lcom/noshufou/android/su/widget/SlidingPanel;->mContentId:I

    invoke-virtual {p0, v0}, Lcom/noshufou/android/su/widget/SlidingPanel;->findViewById(I)Landroid/view/View;

    move-result-object v0

    iput-object v0, p0, Lcom/noshufou/android/su/widget/SlidingPanel;->mContent:Landroid/view/View;

    .line 84
    iget-object v0, p0, Lcom/noshufou/android/su/widget/SlidingPanel;->mContent:Landroid/view/View;

    if-nez v0, :cond_2

    .line 85
    new-instance v0, Ljava/lang/IllegalArgumentException;

    const-string v1, "The content attribute must refer to a child"

    invoke-direct {v0, v1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v0

    .line 87
    :cond_2
    return-void
.end method

.method protected onLayout(ZIIII)V
    .locals 9
    .parameter "changed"
    .parameter "l"
    .parameter "t"
    .parameter "r"
    .parameter "b"

    .prologue
    const/4 v8, 0x0

    .line 113
    iget-object v1, p0, Lcom/noshufou/android/su/widget/SlidingPanel;->mButton:Landroid/view/View;

    .line 114
    .local v1, button:Landroid/view/View;
    invoke-virtual {v1}, Landroid/view/View;->getMeasuredWidth()I

    move-result v4

    invoke-virtual {v1}, Landroid/view/View;->getMeasuredHeight()I

    move-result v5

    invoke-virtual {v1, v8, v8, v4, v5}, Landroid/view/View;->layout(IIII)V

    .line 116
    iget-object v0, p0, Lcom/noshufou/android/su/widget/SlidingPanel;->mAnchor:Landroid/view/View;

    .line 117
    .local v0, anchor:Landroid/view/View;
    invoke-virtual {v1}, Landroid/view/View;->getMeasuredHeight()I

    move-result v4

    invoke-virtual {v0}, Landroid/view/View;->getMeasuredWidth()I

    move-result v5

    .line 118
    invoke-virtual {v1}, Landroid/view/View;->getMeasuredHeight()I

    move-result v6

    invoke-virtual {v0}, Landroid/view/View;->getMeasuredHeight()I

    move-result v7

    add-int/2addr v6, v7

    .line 117
    invoke-virtual {v0, v8, v4, v5, v6}, Landroid/view/View;->layout(IIII)V

    .line 120
    iget-object v2, p0, Lcom/noshufou/android/su/widget/SlidingPanel;->mContent:Landroid/view/View;

    .line 122
    .local v2, content:Landroid/view/View;
    iget-boolean v4, p0, Lcom/noshufou/android/su/widget/SlidingPanel;->mAnimating:Z

    if-eqz v4, :cond_0

    .line 123
    invoke-virtual {v2}, Landroid/view/View;->getLeft()I

    move-result v3

    .line 130
    .local v3, contentLeft:I
    :goto_0
    invoke-virtual {v2}, Landroid/view/View;->getMeasuredWidth()I

    move-result v4

    add-int/2addr v4, v3

    .line 131
    invoke-virtual {v2}, Landroid/view/View;->getMeasuredHeight()I

    move-result v5

    .line 129
    invoke-virtual {v2, v3, v8, v4, v5}, Landroid/view/View;->layout(IIII)V

    .line 132
    return-void

    .line 124
    .end local v3           #contentLeft:I
    :cond_0
    iget-boolean v4, p0, Lcom/noshufou/android/su/widget/SlidingPanel;->mExpanded:Z

    if-eqz v4, :cond_1

    .line 125
    iget v3, p0, Lcom/noshufou/android/su/widget/SlidingPanel;->mClosedLimit:I

    .restart local v3       #contentLeft:I
    goto :goto_0

    .line 127
    .end local v3           #contentLeft:I
    :cond_1
    invoke-virtual {v0}, Landroid/view/View;->getRight()I

    move-result v4

    iget v5, p0, Lcom/noshufou/android/su/widget/SlidingPanel;->mOpenOverlap:I

    sub-int v3, v4, v5

    .restart local v3       #contentLeft:I
    goto :goto_0
.end method

.method protected onMeasure(II)V
    .locals 9
    .parameter "widthMeasureSpec"
    .parameter "heightMeasureSpec"

    .prologue
    const/4 v6, 0x0

    const/high16 v8, 0x4000

    .line 91
    invoke-static {v6, p1}, Landroid/view/View;->resolveSize(II)I

    move-result v5

    .line 92
    .local v5, width:I
    invoke-static {v6, p2}, Landroid/view/View;->resolveSize(II)I

    move-result v4

    .line 94
    .local v4, height:I
    iget-object v0, p0, Lcom/noshufou/android/su/widget/SlidingPanel;->mAnchor:Landroid/view/View;

    .line 95
    .local v0, anchor:Landroid/view/View;
    invoke-virtual {p0, v0, p1, p2}, Lcom/noshufou/android/su/widget/SlidingPanel;->measureChild(Landroid/view/View;II)V

    .line 97
    iget-object v1, p0, Lcom/noshufou/android/su/widget/SlidingPanel;->mButton:Landroid/view/View;

    .line 98
    .local v1, button:Landroid/view/View;
    invoke-virtual {v0}, Landroid/view/View;->getMeasuredWidth()I

    move-result v6

    invoke-static {v6, v8}, Landroid/view/View$MeasureSpec;->makeMeasureSpec(II)I

    move-result v6

    invoke-virtual {p0, v1, v6, p2}, Lcom/noshufou/android/su/widget/SlidingPanel;->measureChild(Landroid/view/View;II)V

    .line 101
    new-instance v6, Lcom/noshufou/android/su/widget/SlidingPanel$Toggler;

    const/4 v7, 0x0

    invoke-direct {v6, p0, v7}, Lcom/noshufou/android/su/widget/SlidingPanel$Toggler;-><init>(Lcom/noshufou/android/su/widget/SlidingPanel;Lcom/noshufou/android/su/widget/SlidingPanel$Toggler;)V

    invoke-virtual {v1, v6}, Landroid/view/View;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 103
    iget-object v2, p0, Lcom/noshufou/android/su/widget/SlidingPanel;->mContent:Landroid/view/View;

    .line 104
    .local v2, content:Landroid/view/View;
    iget v6, p0, Lcom/noshufou/android/su/widget/SlidingPanel;->mClosedLimit:I

    sub-int v3, v5, v6

    .line 105
    .local v3, contentWidth:I
    invoke-static {v3, v8}, Landroid/view/View$MeasureSpec;->makeMeasureSpec(II)I

    move-result v6

    .line 106
    invoke-static {v4, v8}, Landroid/view/View$MeasureSpec;->makeMeasureSpec(II)I

    move-result v7

    .line 105
    invoke-virtual {v2, v6, v7}, Landroid/view/View;->measure(II)V

    .line 108
    invoke-virtual {p0, v5, v4}, Lcom/noshufou/android/su/widget/SlidingPanel;->setMeasuredDimension(II)V

    .line 109
    return-void
.end method

.method public toggle()V
    .locals 8

    .prologue
    const/4 v5, 0x1

    const/4 v7, 0x0

    .line 135
    iget-object v2, p0, Lcom/noshufou/android/su/widget/SlidingPanel;->mContent:Landroid/view/View;

    .line 137
    .local v2, content:Landroid/view/View;
    iget-object v0, p0, Lcom/noshufou/android/su/widget/SlidingPanel;->mAnchor:Landroid/view/View;

    .line 138
    .local v0, anchor:Landroid/view/View;
    invoke-virtual {v0}, Landroid/view/View;->getMeasuredWidth()I

    move-result v4

    iget v6, p0, Lcom/noshufou/android/su/widget/SlidingPanel;->mOpenOverlap:I

    sub-int/2addr v4, v6

    iget v6, p0, Lcom/noshufou/android/su/widget/SlidingPanel;->mClosedLimit:I

    sub-int v3, v4, v6

    .line 140
    .local v3, offset:I
    iget-boolean v4, p0, Lcom/noshufou/android/su/widget/SlidingPanel;->mExpanded:Z

    if-eqz v4, :cond_0

    .line 141
    new-instance v1, Landroid/view/animation/TranslateAnimation;

    int-to-float v4, v3

    invoke-direct {v1, v7, v4, v7, v7}, Landroid/view/animation/TranslateAnimation;-><init>(FFFF)V

    .line 142
    .local v1, anim:Landroid/view/animation/TranslateAnimation;
    iput v3, p0, Lcom/noshufou/android/su/widget/SlidingPanel;->mFillOffset:I

    .line 147
    :goto_0
    iget-boolean v4, p0, Lcom/noshufou/android/su/widget/SlidingPanel;->mExpanded:Z

    if-eqz v4, :cond_1

    const/4 v4, 0x0

    :goto_1
    iput-boolean v4, p0, Lcom/noshufou/android/su/widget/SlidingPanel;->mExpanded:Z

    .line 148
    invoke-virtual {v1, v5}, Landroid/view/animation/TranslateAnimation;->setFillEnabled(Z)V

    .line 149
    invoke-virtual {v1, v5}, Landroid/view/animation/TranslateAnimation;->setFillBefore(Z)V

    .line 150
    const-wide/16 v4, 0x12c

    invoke-virtual {v1, v4, v5}, Landroid/view/animation/TranslateAnimation;->setDuration(J)V

    .line 151
    new-instance v4, Landroid/view/animation/AccelerateDecelerateInterpolator;

    invoke-direct {v4}, Landroid/view/animation/AccelerateDecelerateInterpolator;-><init>()V

    invoke-virtual {v1, v4}, Landroid/view/animation/TranslateAnimation;->setInterpolator(Landroid/view/animation/Interpolator;)V

    .line 152
    new-instance v4, Lcom/noshufou/android/su/widget/SlidingPanel$AnimationFiller;

    const/4 v5, 0x0

    invoke-direct {v4, p0, v5}, Lcom/noshufou/android/su/widget/SlidingPanel$AnimationFiller;-><init>(Lcom/noshufou/android/su/widget/SlidingPanel;Lcom/noshufou/android/su/widget/SlidingPanel$AnimationFiller;)V

    invoke-virtual {v1, v4}, Landroid/view/animation/TranslateAnimation;->setAnimationListener(Landroid/view/animation/Animation$AnimationListener;)V

    .line 153
    invoke-virtual {v2, v1}, Landroid/view/View;->startAnimation(Landroid/view/animation/Animation;)V

    .line 154
    return-void

    .line 144
    .end local v1           #anim:Landroid/view/animation/TranslateAnimation;
    :cond_0
    new-instance v1, Landroid/view/animation/TranslateAnimation;

    neg-int v4, v3

    int-to-float v4, v4

    invoke-direct {v1, v7, v4, v7, v7}, Landroid/view/animation/TranslateAnimation;-><init>(FFFF)V

    .line 145
    .restart local v1       #anim:Landroid/view/animation/TranslateAnimation;
    neg-int v4, v3

    iput v4, p0, Lcom/noshufou/android/su/widget/SlidingPanel;->mFillOffset:I

    goto :goto_0

    :cond_1
    move v4, v5

    .line 147
    goto :goto_1
.end method
